<%--
  Created by IntelliJ IDEA.
  User: 20064
  Date: 2020/2/12
  Time: 16:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>用户登录(测试,登录请用userLogin.jsp)</title>
    <!-- 字体 -->
    <link href="https://fonts.font.im/css?family=Ruslan+Display" rel="stylesheet">

    <!-- 图标 -->
    <link rel="icon" type="image/png" sizes="144x144" href="../images/airplane.png"/>
    <link rel="apple-touch-icon" type="image/png" sizes="144x144" href="../images/airplane.png"/>
    <link href="../js/font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet">

    <!-- 其他 -->
    <link rel="stylesheet" href="../js/bootstrap-4.4.1-dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="../css/userLogin.css">
    <style type="text/css">

    </style>

</head>
<body>
<div class="bg">
    <img src="../images/plane1.jpg" alt="">
</div>
<div class="container">
    <div class="row">&nbsp;</div>

    <div class="row">&nbsp;</div>
    <div class="row">
        <div class="row-body">
            <div class="left">
                <div class="card">
                    <div class="card-body">
                        <form action="" method="post">
                            <div class="form-group">
                                <input class="form-control" type="text" name="userAccount" placeholder="请输入账号"
                                       required="required">
                            </div>
                            <div class="form-group">
                                <input class="form-control" type="password" name="userPwd" placeholder="请输入密码"
                                       required="required">
                            </div>
                            <div class="w-100 m-auto text-center">
                                <button class="btn btn-info w-50" type="submit">登录</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <div class="right text-right">
                <p>世界那么大，我想去看看。</p>
                <p>There is such a lot of things</p>
                <p>on the world to see.</p>
            </div>
        </div>
    </div>

</div>


<c:if test="${msg!=null}">
    <script type="text/javascript">
        alert("${msg}");
    </script>
</c:if>

</body>
<script type="text/javascript" src="../js/jquery-3.4.1/jquery-3.4.1.js"></script>
<script type="text/javascript" src="../js/bootstrap-4.4.1-dist/js/bootstrap.min.js"></script>
<script type="text/javascript">
    // function login(btn) {
    //     $(btn).text("登陆中。。。");
    //     var confirmUser = checkUserInfo();
    //     if (confirmUser === true) {
    //         $("form").submit();
    //     } else {
    //         $("input[name='userAccount']").val("");
    //         $("input[name='userPwd']").val("");
    //         $(btn).text("登陆");
    //     }
    // }

    // $("form").submit(function () {
    //     $("button").text("登陆中。。。");
    //     var confirmUser = checkUserInfo();
    //     if (confirmUser === true) {
    //         return true;
    //     } else {
    //         $("input[name='userAccount']").val("");
    //         $("input[name='userPwd']").val("");
    //         $(".btn").text("登陆");
    //     }
    //     return false;
    // });
    //
    // function checkUserInfo() {
    //     var check = false;
    //     $.ajax({
    //         async: false,
    //         url: "checkUserInfo.do",
    //         type: "post",
    //         data: {userAccount: $("input[name='userAccount']").val(), userPwd: $("input[name='userPwd']").val()},
    //         dataType: "json",
    //         success: function (result) {
    //             check = result.check;
    //             if (check === false) {
    //                 alert(result.msg);
    //             }
    //         }
    //     });
    //     return check;
    // }


</script>
</html>
